<?php

//set these variables
$url = 'http://twitter.com/inkplant'; //the URL you want to take a screen shot of
$image_filename = 'img_screen/screen1.jpg'; //where you want to save the image (needs to be a jpg in this example)
$width = 1000; //in pixels
$height = 800; //in pixels
$screenshot_url = 'http://augustin.co.kr/adm/adm_new/screenshot.php'; //the full address of the file we just created
$resized_width = 300; //if you want to shrink the image, set this to a value in pixels.  otherwise, set it to false

//now we connect to the screenshot script
$full_url = $screenshot_url.'?url='.urlencode($url).'&width='.$width.'&height='.$height.'&resized_width='.$resized_width;
$handle = fopen($full_url, "rb") or die("Error! Couldn't open URL."); //open in binary mode
$output = stream_get_contents($handle);
fclose($handle);
if (!$output) { die('Error! Output was not generated!'); }

//save the returned image
$fp = fopen($image_filename, 'w') or die('Error! Could not open image file!');
fwrite($fp, $output) or die('Error! Could not write image file!');
fclose($fp);

//finally, display your new image
echo '<p><img src="'.$image_filename.'" /><br />'.$image_filename.'</p>';

?>